package com.hwz.mapper;

import com.github.pagehelper.Page;
import com.hwz.annotation.AutoFill;
import com.hwz.dto.DishPageQueryDTO;
import com.hwz.entity.Dish;
import com.hwz.enumeration.OperationType;
import com.hwz.vo.DishVO;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;
import java.util.Map;

@Mapper
public interface DishMapper {
    Integer getCountByCategoryId(Long id);

    @AutoFill(value = OperationType.INSERT)
    void insert(Dish dish);

    Dish selectById(Long id);

    List<Dish> selectByCategoryId(Long categoryId);

    Page<DishVO> getDishPage(DishPageQueryDTO dishPageQueryDTO);

    @AutoFill(OperationType.UPDATE)
    void update(Dish dish);

    void deleteBatchIds(List<Long> ids);

    Integer countByMap(Map map);
}
